package com.myblog.mapper;

import com.myblog.pojo.Article;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface Articlemapper {
    @Select("SELECT * FROM article ORDER BY article.time DESC")
    public List<Article> find();

    @Select("SELECT * FROM article WHERE id=#{aid}")
    public Article findbyid(@Param("aid") int aid);

    @Select("SELECT * FROM article WHERE tag=#{tag}")
    public List<Article> findtag(@Param("tag")String tag);
}
